package com.baitengsoft.patentapimonitor.api.service.impl;

import com.baitengsoft.patentapimonitor.api.entity.WebUserareaEntity;
import com.baitengsoft.patentapimonitor.api.service.WebUserareaService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Admin on 2017/12/26.
 */
@Service
public class WebUserareaServiceImpl extends BaseServiceImpl<WebUserareaEntity> implements WebUserareaService{


    @Override
    public List<WebUserareaEntity> searchUserareaByUserId(int platformUserId) {

        WebUserareaEntity entity=new WebUserareaEntity();
        entity.setUserid(platformUserId);
        List<WebUserareaEntity> entities=queryListByWhere(entity);
        return entities;
    }

    @Override
    public Integer delUserareaByUserId(int userId) {

        WebUserareaEntity entity=new WebUserareaEntity();
        entity.setUserid(userId);
        return deleteByWhere(entity);
    }

    @Override
    public Integer saveUserarea(WebUserareaEntity entity) {
        return saveByNotNull(entity);
    }
}
